<template>
    <div>
        <h4>添加汽车</h4>
        品牌:<input type="text" v-model="carObj.type"><br>
        价格:<input type="text" v-model="carObj.price"><br>
        产地:<input type="text" v-model="carObj.address"><br>
         <input type="button" value="添加" @click="addCar">
    </div>
</template>

<script>
export default {
        data(){
            return{
                carObj:{}
            }
        },
        methods:{
            async addCar(){
              var info =  await this.ajax.getSubmit("/project/car/add",this.carObj);
              if(info == "ok"){
                  alert("添加成功");
                   this.$emit("findByItem",{page:1});
                   this.carObj = {};
              }
            }
        }
}
</script>

<style>

</style>